package com.hmall.mapper;

import com.hmall.model.MallShipping;
import com.hmall.util.MyMapper;
import com.hmall.vo.MallShippingVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface MallShippingMapper extends MyMapper<MallShipping> {

    List<MallShippingVo> selectByUserName(String username);

    void deleteByShippingIdUserId(@Param("userId") Integer userId, @Param("shippingId") Integer shippingId);

    int updateByShipping(@Param("ship") MallShipping ship);

    MallShipping selectByShippingIdUserId(@Param("userId") Integer userId, @Param("shippingId") Integer shippingId);

    List<MallShipping> selectByUserId(@Param("userId") Integer userId);

    List selectPartByUserId(@Param("userId") Integer userId);

    int insert(@Param("ship") MallShipping ship);
    //更新默认
    int updateDefaultShipping(@Param("ship") MallShipping ship);
    //把default 1 改成0
    int updateNoDefaultShipping(@Param("userId") Integer userId);
    int myInsert(@Param("ship") MallShipping shipping);
    //根据ID查询地址
    MallShipping selectByShippingId(@Param("shippingId") Integer shippingId);
}